Imports DocumentFormat.OpenXml.Spreadsheet
Imports FineUI
Imports Kimmo
Imports Microsoft.VisualBasic.CompilerServices
Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlServerCe
Imports System.Diagnostics
Imports System.Runtime.CompilerServices

''' <summary>
''' This is the beginning of the Project_Budget business object to handle interaction between the user interface and the database.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Class clsProjectBudget
    Public Property Id As String = ""
    Public Property ProjectId As Integer = 0
    Public Property StageId As Integer = 0
    Public Property StageName As String = ""
    Public Property Budget As Double = 0
    Public Property Funded As Double = 0
    Public Property Shortfall As Double = 0
    Public Property IsNew As Boolean = False
    Public Property DateFields As String = ""
    Public Property FieldsToUpdate As String = "Id,ProjectId,StageId,StageName,Budget,Funded,Shortfall"

''' <summary>
''' The new method of the class to create new Project_Budget records.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Sub New()
    MyBase.New()
    Clear()
    IsNew = True
    DateFields = ""
    FieldsToUpdate = "Id,ProjectId,StageId,StageName,Budget,Funded,Shortfall"
End Sub

''' <summary>
''' The Clear method clears all properties of the business object to defaults.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Sub Clear()
    Id = ""
    ProjectId = 0
    StageId = 0
    StageName = ""
    Budget = 0
    Funded = 0
    Shortfall = 0
End Sub

''' <summary>
''' Delete Project_Budget records specified by a list of ID.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Sub Delete(ByRef Records As List(Of String))
        For Each rsStr As String In Records
            SQLCompact.RunQuery("delete from [Project_Budget] where ID = " & rsStr, True)
        Next
    End Sub


''' <summary>
''' Delete Project_Budget records meeting a particular field name criteria. In this case, Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteById(ByVal strId As String)
    SQLCompact.RunQuery("Delete from [Project_Budget] where [Id] = '" & strId & "'")
End Sub

''' <summary>
''' Delete Project_Budget records from a list of particular field. In this case, Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfId(ByRef Records As List(Of String))
        For Each strId As String In Records
    SQLCompact.RunQuery("Delete from [Project_Budget] where [Id] = '" & strId & "'")
        Next
End Sub

''' <summary>
''' Delete Project_Budget records meeting a particular field name criteria. In this case, ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByProjectId(ByVal intProjectId As Integer)
    SQLCompact.RunQuery("Delete from [Project_Budget] where [ProjectId] = " & intProjectId)
End Sub

''' <summary>
''' Delete Project_Budget records from a list of particular field. In this case, ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfProjectId(ByRef Records As List(Of String))
        For Each intProjectId As String In Records
    SQLCompact.RunQuery("Delete from [Project_Budget] where [ProjectId] = " & intProjectId)
        Next
End Sub

''' <summary>
''' Delete Project_Budget records meeting a particular field name criteria. In this case, StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByStageId(ByVal intStageId As Integer)
    SQLCompact.RunQuery("Delete from [Project_Budget] where [StageId] = " & intStageId)
End Sub

''' <summary>
''' Delete Project_Budget records from a list of particular field. In this case, StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfStageId(ByRef Records As List(Of String))
        For Each intStageId As String In Records
    SQLCompact.RunQuery("Delete from [Project_Budget] where [StageId] = " & intStageId)
        Next
End Sub

''' <summary>
''' Delete Project_Budget records meeting a particular field name criteria. In this case, StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByStageName(ByVal strStageName As String)
    SQLCompact.RunQuery("Delete from [Project_Budget] where [StageName] = '" & strStageName & "'")
End Sub

''' <summary>
''' Delete Project_Budget records from a list of particular field. In this case, StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfStageName(ByRef Records As List(Of String))
        For Each strStageName As String In Records
    SQLCompact.RunQuery("Delete from [Project_Budget] where [StageName] = '" & strStageName & "'")
        Next
End Sub

''' <summary>
''' Delete Project_Budget records meeting a particular field name criteria. In this case, Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByBudget(ByVal dblBudget As Double)
    SQLCompact.RunQuery("Delete from [Project_Budget] where [Budget] = " & dblBudget)
End Sub

''' <summary>
''' Delete Project_Budget records from a list of particular field. In this case, Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfBudget(ByRef Records As List(Of String))
        For Each dblBudget As String In Records
    SQLCompact.RunQuery("Delete from [Project_Budget] where [Budget] = " & dblBudget)
        Next
End Sub

''' <summary>
''' Delete Project_Budget records meeting a particular field name criteria. In this case, Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByFunded(ByVal dblFunded As Double)
    SQLCompact.RunQuery("Delete from [Project_Budget] where [Funded] = " & dblFunded)
End Sub

''' <summary>
''' Delete Project_Budget records from a list of particular field. In this case, Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfFunded(ByRef Records As List(Of String))
        For Each dblFunded As String In Records
    SQLCompact.RunQuery("Delete from [Project_Budget] where [Funded] = " & dblFunded)
        Next
End Sub

''' <summary>
''' Delete Project_Budget records meeting a particular field name criteria. In this case, Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByShortfall(ByVal dblShortfall As Double)
    SQLCompact.RunQuery("Delete from [Project_Budget] where [Shortfall] = " & dblShortfall)
End Sub

''' <summary>
''' Delete Project_Budget records from a list of particular field. In this case, Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub DeleteByListOfShortfall(ByRef Records As List(Of String))
        For Each dblShortfall As String In Records
    SQLCompact.RunQuery("Delete from [Project_Budget] where [Shortfall] = " & dblShortfall)
        Next
End Sub

''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Id based on Project_Budget.Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IdById(ByVal strId As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Id", strId, "Id", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Id based on Project_Budget.ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IdByProjectId(ByVal intProjectId As Integer) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "ProjectId", intProjectId, "Id", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.ProjectId based on Project_Budget.Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ProjectIdById(ByVal strId As String) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Id", strId, "ProjectId", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Id based on Project_Budget.StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IdByStageId(ByVal intStageId As Integer) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageId", intStageId, "Id", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageId based on Project_Budget.Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageIdById(ByVal strId As String) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Id", strId, "StageId", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Id based on Project_Budget.StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IdByStageName(ByVal strStageName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageName", strStageName, "Id", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageName based on Project_Budget.Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageNameById(ByVal strId As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Id", strId, "StageName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Id based on Project_Budget.Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IdByBudget(ByVal dblBudget As Double) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Budget", dblBudget, "Id", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Budget based on Project_Budget.Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function BudgetById(ByVal strId As String) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Id", strId, "Budget", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Id based on Project_Budget.Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IdByFunded(ByVal dblFunded As Double) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Funded", dblFunded, "Id", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Funded based on Project_Budget.Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FundedById(ByVal strId As String) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Id", strId, "Funded", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Id based on Project_Budget.Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function IdByShortfall(ByVal dblShortfall As Double) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Shortfall", dblShortfall, "Id", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Shortfall based on Project_Budget.Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ShortfallById(ByVal strId As String) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Id", strId, "Shortfall", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.ProjectId based on Project_Budget.ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ProjectIdByProjectId(ByVal intProjectId As Integer) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "ProjectId", intProjectId, "ProjectId", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.ProjectId based on Project_Budget.StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ProjectIdByStageId(ByVal intStageId As Integer) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageId", intStageId, "ProjectId", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageId based on Project_Budget.ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageIdByProjectId(ByVal intProjectId As Integer) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "ProjectId", intProjectId, "StageId", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.ProjectId based on Project_Budget.StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ProjectIdByStageName(ByVal strStageName As String) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageName", strStageName, "ProjectId", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageName based on Project_Budget.ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageNameByProjectId(ByVal intProjectId As Integer) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "ProjectId", intProjectId, "StageName", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.ProjectId based on Project_Budget.Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ProjectIdByBudget(ByVal dblBudget As Double) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Budget", dblBudget, "ProjectId", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Budget based on Project_Budget.ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function BudgetByProjectId(ByVal intProjectId As Integer) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "ProjectId", intProjectId, "Budget", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.ProjectId based on Project_Budget.Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ProjectIdByFunded(ByVal dblFunded As Double) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Funded", dblFunded, "ProjectId", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Funded based on Project_Budget.ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FundedByProjectId(ByVal intProjectId As Integer) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "ProjectId", intProjectId, "Funded", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.ProjectId based on Project_Budget.Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ProjectIdByShortfall(ByVal dblShortfall As Double) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Shortfall", dblShortfall, "ProjectId", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Shortfall based on Project_Budget.ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ShortfallByProjectId(ByVal intProjectId As Integer) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "ProjectId", intProjectId, "Shortfall", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageId based on Project_Budget.StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageIdByStageId(ByVal intStageId As Integer) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageId", intStageId, "StageId", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageId based on Project_Budget.StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageIdByStageName(ByVal strStageName As String) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageName", strStageName, "StageId", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageName based on Project_Budget.StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageNameByStageId(ByVal intStageId As Integer) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageId", intStageId, "StageName", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageId based on Project_Budget.Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageIdByBudget(ByVal dblBudget As Double) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Budget", dblBudget, "StageId", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Budget based on Project_Budget.StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function BudgetByStageId(ByVal intStageId As Integer) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageId", intStageId, "Budget", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageId based on Project_Budget.Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageIdByFunded(ByVal dblFunded As Double) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Funded", dblFunded, "StageId", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Funded based on Project_Budget.StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FundedByStageId(ByVal intStageId As Integer) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageId", intStageId, "Funded", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageId based on Project_Budget.Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageIdByShortfall(ByVal dblShortfall As Double) As Integer
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Shortfall", dblShortfall, "StageId", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Shortfall based on Project_Budget.StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ShortfallByStageId(ByVal intStageId As Integer) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageId", intStageId, "Shortfall", ";", "Integer")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageName based on Project_Budget.StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageNameByStageName(ByVal strStageName As String) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageName", strStageName, "StageName", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageName based on Project_Budget.Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageNameByBudget(ByVal dblBudget As Double) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Budget", dblBudget, "StageName", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Budget based on Project_Budget.StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function BudgetByStageName(ByVal strStageName As String) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageName", strStageName, "Budget", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageName based on Project_Budget.Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageNameByFunded(ByVal dblFunded As Double) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Funded", dblFunded, "StageName", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Funded based on Project_Budget.StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FundedByStageName(ByVal strStageName As String) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageName", strStageName, "Funded", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.StageName based on Project_Budget.Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function StageNameByShortfall(ByVal dblShortfall As Double) As String
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Shortfall", dblShortfall, "StageName", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return mv
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Shortfall based on Project_Budget.StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ShortfallByStageName(ByVal strStageName As String) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "StageName", strStageName, "Shortfall", ";", "String")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Budget based on Project_Budget.Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function BudgetByBudget(ByVal dblBudget As Double) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Budget", dblBudget, "Budget", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Budget based on Project_Budget.Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function BudgetByFunded(ByVal dblFunded As Double) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Funded", dblFunded, "Budget", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Funded based on Project_Budget.Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FundedByBudget(ByVal dblBudget As Double) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Budget", dblBudget, "Funded", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Budget based on Project_Budget.Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function BudgetByShortfall(ByVal dblShortfall As Double) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Shortfall", dblShortfall, "Budget", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Shortfall based on Project_Budget.Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ShortfallByBudget(ByVal dblBudget As Double) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Budget", dblBudget, "Shortfall", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Funded based on Project_Budget.Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FundedByFunded(ByVal dblFunded As Double) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Funded", dblFunded, "Funded", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Funded based on Project_Budget.Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function FundedByShortfall(ByVal dblShortfall As Double) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Shortfall", dblShortfall, "Funded", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Shortfall based on Project_Budget.Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ShortfallByFunded(ByVal dblFunded As Double) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Funded", dblFunded, "Shortfall", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return a particular field based on another field. In this case return Project_Budget.Shortfall based on Project_Budget.Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ShortfallByShortfall(ByVal dblShortfall As Double) As Double
    Dim mv As String = SQLCompact.RecordReadToMv("Project_Budget", "Shortfall", dblShortfall, "Shortfall", ";", "Double")
    mv = clsDL.MvField(mv, 1, ";")
    Return Val(mv)
End Function


''' <summary>
''' Return the list of strings of a particular field. In this case Project_Budget.Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function IdList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("Project_Budget", "Id", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case Project_Budget.ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function ProjectIdList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("Project_Budget", "ProjectId", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case Project_Budget.StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function StageIdList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("Project_Budget", "StageId", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case Project_Budget.StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function StageNameList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("Project_Budget", "StageName", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case Project_Budget.Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function BudgetList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("Project_Budget", "Budget", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case Project_Budget.Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function FundedList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("Project_Budget", "Funded", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the list of strings of a particular field. In this case Project_Budget.Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
    Public Shared Function ShortfallList(Optional bAddNone As Boolean = False, Optional bIsDate As Boolean = False, Optional FldDelim As String = ";") As List(Of String)
        Dim strs As List(Of String) = SQLCompact.TableDistinctList("Project_Budget", "Shortfall", "{0}", bAddNone, bIsDate, FldDelim)
        Return strs
    End Function

''' <summary>
''' Return the total number of records in the table Project_Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function Count() As Integer
Dim nRecords As Integer = 0
Dim dt As DataTable = SQLCompact.OpenDataTable("select Count(ID) as Records from [Project_Budget]")
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function


''' <summary>
''' Return the total number of records with a particular value in a field. In this case Project_Budget.Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountById(ByVal strId As String) As Integer
Dim sQry As String = "Select Count(ID) As Records from [Project_Budget] where [Id] = '" & strId & "'"
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case Project_Budget.ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByProjectId(ByVal intProjectId As Integer) As Integer
Dim sQry As String = "Select Count(ID) As Records from [Project_Budget] where [ProjectId] = " & intProjectId
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case Project_Budget.StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByStageId(ByVal intStageId As Integer) As Integer
Dim sQry As String = "Select Count(ID) As Records from [Project_Budget] where [StageId] = " & intStageId
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case Project_Budget.StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByStageName(ByVal strStageName As String) As Integer
Dim sQry As String = "Select Count(ID) As Records from [Project_Budget] where [StageName] = '" & strStageName & "'"
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case Project_Budget.Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByBudget(ByVal dblBudget As Double) As Integer
Dim sQry As String = "Select Count(ID) As Records from [Project_Budget] where [Budget] = " & dblBudget
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case Project_Budget.Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByFunded(ByVal dblFunded As Double) As Integer
Dim sQry As String = "Select Count(ID) As Records from [Project_Budget] where [Funded] = " & dblFunded
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return the total number of records with a particular value in a field. In this case Project_Budget.Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function CountByShortfall(ByVal dblShortfall As Double) As Integer
Dim sQry As String = "Select Count(ID) As Records from [Project_Budget] where [Shortfall] = " & dblShortfall
Dim dt As DataTable = SQLCompact.OpenDataTable(sQRY)
Dim nRecords as integer = 0
For Each dr As DataRow In dt.Rows
nRecords = Val(dr("Records").ToString)
Next
Return nRecords
End Function

''' <summary>
''' Return True or False if a particular Project_Budget record exists.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function Exists(ByVal intID as Integer) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("Project_Budget", "ID", intID, "Long")
Return flag
End Function


''' <summary>
''' Return True or False if a particular Project_Budget record exists based on Id
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsById(ByVal strId As String) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("Project_Budget", "Id", strId, "String")
Return flag
End Function

''' <summary>
''' Return True or False if a particular Project_Budget record exists based on ProjectId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByProjectId(ByVal intProjectId As Integer) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("Project_Budget", "ProjectId", intProjectId, "Integer")
Return flag
End Function

''' <summary>
''' Return True or False if a particular Project_Budget record exists based on StageId
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByStageId(ByVal intStageId As Integer) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("Project_Budget", "StageId", intStageId, "Integer")
Return flag
End Function

''' <summary>
''' Return True or False if a particular Project_Budget record exists based on StageName
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByStageName(ByVal strStageName As String) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("Project_Budget", "StageName", strStageName, "String")
Return flag
End Function

''' <summary>
''' Return True or False if a particular Project_Budget record exists based on Budget
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByBudget(ByVal dblBudget As Double) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("Project_Budget", "Budget", dblBudget, "Double")
Return flag
End Function

''' <summary>
''' Return True or False if a particular Project_Budget record exists based on Funded
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByFunded(ByVal dblFunded As Double) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("Project_Budget", "Funded", dblFunded, "Double")
Return flag
End Function

''' <summary>
''' Return True or False if a particular Project_Budget record exists based on Shortfall
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Function ExistsByShortfall(ByVal dblShortfall As Double) As Boolean
Dim flag As Boolean = SQLCompact.RecordExists("Project_Budget", "Shortfall", dblShortfall, "Double")
Return flag
End Function

''' <summary>
''' Read Method to read Project_Budget record from the database using a primarykey.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Sub Read(ByVal sID As String)
Try
Clear()
Dim nRead As New DataSet()
nRead = SQLCompact.RecordSeek("Project_Budget", "ID", sID, "*", "Integer")
Dim xCount As Boolean = nRead.Tables(0).Rows.Count - 1 <> -1
If xCount Then
Dim xRow As DataRow = nRead.Tables(0).Rows(0)
Id = xRow("Id").ToString
ProjectId = Val(xRow("ProjectId").ToString)
StageId = Val(xRow("StageId").ToString)
StageName = xRow("StageName").ToString
Budget = Val(xRow("Budget").ToString)
Funded = Val(xRow("Funded").ToString)
Shortfall = Val(xRow("Shortfall").ToString)
Me.IsNew = False
nRead.Dispose()
End If
Catch exc as Exception
Throw new Exception(exc.Message)
End Try
End Sub

''' <summary>
''' Save a Project_Budget record to the database using a primary key. This uses a property get and FieldsToUpdate, DateFields to update the database.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Sub Save()
Try
Dim strTable As String = "Project_Budget"
Dim strPriKey As String = "ID"
Dim CommText As String = ""
Dim xCommand As New SqlCeCommand
If ID = -1 Then
ID = SQLCompact.TableMaxValue(strTable, strPriKey, "") + 1
IsNew = True
Else
IsNew = False
End If
If FieldsToUpdate = "*" Then
FieldsToUpdate = SQLCompact.Table_FieldNames(strTable, False, ",")
End If
FieldsToUpdate = clsDL.MvRemoveDuplicates(Me.FieldsToUpdate, ",")
Dim strParameters As String = clsDL.MvPrefixBy(FieldsToUpdate, "@", ",")
If IsNew Then
CommText = clsDL.BuildInsertCommand(strTable, FieldsToUpdate, ",")
Else
CommText = clsDL.BuildUpdateCommand(strTable, FieldsToUpdate, strPriKey, ",")
End If
xCommand = SQLCompact.OpenCommand(CommText)
Dim spFields() As String = Split(FieldsToUpdate, ",")
With xCommand
.Parameters.Clear()
For each strField As String In spFields
Dim datePos As Integer = clsDL.MvSearch(DateFields, strField, ",")
If datePos > 0 Then
Dim strValue as string = clsDL.PropertyGet(Me, strField).ToString
.Parameters.AddWithValue("@" & strField, IIf((IsDate(strValue) = True), CDate(strValue), DBNull.Value))
Else
.Parameters.AddWithValue("@" & strField, clsDL.PropertyGet(Me, strField))
End If
Next
.ExecuteNonQuery()
End With
SQLCompact.Connection.Close()
xCommand.Dispose()
Catch exc as Exception
Throw new Exception(exc.Message)
End Try
End Sub

''' <summary>
''' This method builds up an editable grid based on selected records. The grid has Save, Clone and Delete buttons
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub ShowProject_Budget(ByRef grdViews As FineUI.Grid, ByVal strFilter As String)
clsFineUI.Grid.Clear(grdViews, "", "")
clsFineUI.Grid.TableName = "Project_Budget"
clsFineUI.Grid.DataKeyNames = "Id"
clsFineUI.Grid.PageSize = 50
clsFineUI.Grid.AllowPaging = True
clsFineUI.Grid.AllowSorting = True
clsFineUI.Grid.LoadMask = False
clsFineUI.Grid.Title = "Project_Budget"
clsFineUI.Grid.ShowBorder = False
clsFineUI.Grid.ShowHeader = False
clsFineUI.Grid.EnableRowNumber = False
clsFineUI.Grid.AutoHeight = True
clsFineUI.Grid.AutoPostBack = False
clsFineUI.Grid.EnableCheckBoxSelect = True
clsFineUI.Grid.AutoWidth = True
clsFineUI.Grid.EnableAlternateRowColor = True
clsFineUI.Grid.EnableCollapse = False
clsFineUI.Grid.EnableMouseOverColor = True
clsFineUI.Grid.EnableMultiSelect = True
clsFineUI.Grid.EnableViewState = True
clsFineUI.Grid.EnableAjax = True
clsFineUI.Grid.ColumnLines = True
clsFineUI.Grid.ToolTipField = ""
clsFineUI.Grid.IsDatabasePaging = False
clsFineUI.Grid.ShowGridHeader = True
clsFineUI.Grid.EnableHeaderMenu = True
clsFineUI.Grid.EnableColumnHide = True
clsFineUI.Grid.AddTextBox("Id", "Id", "{0}", "", "50", FineUi.TextAlign.Left, False, False, True)
clsFineUI.Grid.AddTextBox("StageName", "Stage Name", "{0}", "", "200", FineUi.TextAlign.Left, False, False, True)
clsFineUI.Grid.AddTextBox("Budget", "Budget", "{0:#,##0.00}", "", "150", FineUi.TextAlign.Right, False, False, True)
clsFineUI.Grid.AddTextBox("Funded", "Funded", "{0:#,##0.00}", "", "150", FineUi.TextAlign.Right, False, False, True)
clsFineUI.Grid.AddTextBox("Shortfall", "Shortfall", "{0:#,##0.00}", "", "150", FineUi.TextAlign.Right, False, False, True)
clsFineUI.Grid.AddSave()
clsFineUI.Grid.AddClone()
clsFineUI.Grid.AddDelete()
If Len(strFilter) > 0 Then clsFineUI.Grid.Filter = strFilter
clsFineUI.Grid.OrderBy = "Id"
clsFineUI.Grid.BuildSelectCommand()
clsFineUI.Grid.UseSQLCompact = True
clsFineUI.Grid.Update(Nothing)
End Sub

''' <summary>
''' Builds a readonly grid based on selected records, this grid has Edit, Clone, Delete, Like and Comment buttons.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub ShowGrid(ByRef grdViews As FineUI.Grid, ByVal strFilter As String)
clsFineUI.Grid.Clear(grdViews, "", "")
clsFineUI.Grid.TableName = "Project_Budget"
clsFineUI.Grid.DataKeyNames = "Id"
clsFineUI.Grid.PageSize = 50
clsFineUI.Grid.AllowPaging = True
clsFineUI.Grid.AllowSorting = True
clsFineUI.Grid.LoadMask = False
clsFineUI.Grid.Title = "Project_Budget"
clsFineUI.Grid.ShowBorder = False
clsFineUI.Grid.ShowHeader = False
clsFineUI.Grid.EnableRowNumber = False
clsFineUI.Grid.AutoHeight = True
clsFineUI.Grid.AutoPostBack = False
clsFineUI.Grid.EnableCheckBoxSelect = True
clsFineUI.Grid.AutoWidth = True
clsFineUI.Grid.EnableAlternateRowColor = True
clsFineUI.Grid.EnableCollapse = False
clsFineUI.Grid.EnableMouseOverColor = True
clsFineUI.Grid.EnableMultiSelect = True
clsFineUI.Grid.EnableViewState = True
clsFineUI.Grid.EnableAjax = True
clsFineUI.Grid.ColumnLines = True
clsFineUI.Grid.ToolTipField = ""
clsFineUI.Grid.IsDatabasePaging = False
clsFineUI.Grid.ShowGridHeader = True
clsFineUI.Grid.EnableHeaderMenu = True
clsFineUI.Grid.EnableColumnHide = True
clsFineUI.Grid.AddColumn("Id", "Id", "{0}", "", "", False, "50", FineUi.TextAlign.Left, False)
clsFineUI.Grid.AddColumn("StageName", "Stage Name", "{0}", "", "", False, "200", FineUi.TextAlign.Left, False)
clsFineUI.Grid.AddColumn("Budget", "Budget", "{0:#,##0.00}", "", "", False, "150", FineUi.TextAlign.Right, False)
clsFineUI.Grid.AddColumn("Funded", "Funded", "{0:#,##0.00}", "", "", False, "150", FineUi.TextAlign.Right, False)
clsFineUI.Grid.AddColumn("Shortfall", "Shortfall", "{0:#,##0.00}", "", "", False, "150", FineUi.TextAlign.Right, False)
clsFineUI.Grid.AddEditCloneDelete()
clsFineUI.Grid.AddLikeComment()
If Len(strFilter) > 0 Then clsFineUI.Grid.Filter = strFilter
clsFineUI.Grid.OrderBy = "Id"
clsFineUI.Grid.BuildSelectCommand()
clsFineUI.Grid.UseSQLCompact = True
clsFineUI.Grid.Update(Nothing)
End Sub

''' <summary>
''' Import Project_Budget records from a csv file.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Shared Sub ImportFile(ByVal SourceFile As String, ByVal FileData As String)
Try
Dim spLines As String() = Strings.Split(FileData, vbCr & vbLf)
For each strLine As String In spLines
strLine = strLine.Trim
If Len(strLine) > 0 Then
Dim spLine As String() = Strings.Split(strLine, ",")
Dim clsNewProjectBudget As New clsProjectBudget
With clsNewProjectBudget
.IsNew = True
.Id = -1
.Save
End With
End If
Next
Catch exc as exception
Throw new Exception(exc.message)
End Try
End Sub

''' <summary>
''' Define a blank Project_Budget record and save it in a database. This method is useful for a grid like interface.
''' </summary>
''' <remarks>This code is automatically generated by SystemBuilder.Show.</remarks>
Public Sub Blank()
Dim clsNewProjectBudget As New clsProjectBudget
clsNewProjectBudget.Clear()
clsNewProjectBudget.IsNew = True
clsNewProjectBudget.Id = -1
clsNewProjectBudget.Save
clsNewProjectBudget = Nothing
End Sub
End Class

